<h2>e-for嵌套</h2>
<p>多个e-for嵌套时，循环各自的元素的内容。</p>
<p>模板</p>
<pre class="temp"></pre>
<p>代码</p>
<pre class="script"></pre>
<p>输出</p>
<div id="myDiv" ejs>
    <table>
        <tr>
            <th>编号</th>
            <th>用户</th>
            <th>地址</th>
            <th>订单</th>
        </tr>
        <tr e-for="i in userList">
            <td>{{userList[i].id}}</td>
            <td>{{userList[i].user}}</td>
            <td>{{userList[i].address}}</td>
            <td>
                <ul e-for="j in userList[i].orderList">
                    <li>编号：{{userList[i].orderList[j].id}}</li>
                    <li>金额：{{userList[i].orderList[j].amount}}</li>
                    <li>创建：{{userList[i].orderList[j].ctime}}</li>
                    <li>更新：{{EJS.localDate(userList[i].orderList[j].utime)}}</li>
                </ul>
            </td>
        </tr>
        <tr>
            <td colspan="4">共{{total}}条 当前第{{page}}页 有{{userList.length}}条</td>
        </tr>
    </table>
</div>
<br>
<br>
<script src="../js/jquery.min.js"></script>
<script src="../js/ejs.min.js"></script>
<script src="../js/jqejs.js"></script>
<script id="myJs">
$(function() {
    var data = {
        "code": 200,
        "msg": "成功",
        "page": 1,
        "total": 14,
        "userList": [{
            "id": 1,
            "user": "liuzy",
            "address": "上海 浦东新区 张江",
            "orderList": [{
                "id": "20161211",
                "amount": "20.30",
                "ctime": "2016-12-11 12:12:12",
                "utime": 1483078210500
            }]
        }, {
            "id": 2,
            "user": "xiaohy",
            "address": "上海 浦东新区 张江",
            "orderList": [{
                "id": "20161214",
                "amount": "50.00",
                "ctime": "2016-12-11 12:12:12",
                "utime": 1483078230500
            }]
        }, {
            "id": 3,
            "user": "liumy",
            "address": "上海 浦东新区 张江",
            "orderList": [{
                "id": "20161241",
                "amount": "120.00",
                "ctime": "2016-12-11 12:12:12",
                "utime": 1483078212500
            }]
        }]
    }
    $('#myDiv').ejs(data);
});
</script>
